# frozen_string_literal: true
# name: hide-replies-to-guests
# about: Hide replies from guests
# version: 0.1
# authors: Janson
# url: https://gitee.com/jannson/hide-replies-to-guests.git
after_initialize do
	module ::HideRepliesToGuests
		def posts
			result = super
			if !guardian.user
				result.each do |post|
					post.hidden = !post.is_first_post?
				end
			end
			result
		end
	end

	::TopicView.prepend(::HideRepliesToGuests)
end